home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 20
/
Cream of the Crop 20 (Terry Blount) (1996).iso
/
program
/
vbprnt20.zip
/
SRC
/
VBAPI.H
< prev
next >
Wrap
C/C++ Source or Header
|
1996-05-29
|
40KB
|
1,066 lines
//---------------------------------------------------------------------------
// VBAPI.H
//---------------------------------------------------------------------------
// Copyright (c) 1991-1993, Microsoft Corp. All Rights Reserved.
//---------------------------------------------------------------------------
// Include file for the Visual Basic Custom Control and DLL application
// programming interface.
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
// Handle C++ and Pack structures on 1-byte boundaries
//---------------------------------------------------------------------------
#ifdef __cplusplus
extern "C" {
#endif
#ifndef RC_INVOKED
#pragma pack(1)
#endif // ifndef RC_INVOKED
//---------------------------------------------------------------------------
// Version constants
//---------------------------------------------------------------------------
#define VB100_VERSION 0x0100
#define VB200_VERSION 0x0200
#define VB300_VERSION 0x0300
#define VB_VERSION VB300_VERSION
//---------------------------------------------------------------------------
// General types and modifiers
//---------------------------------------------------------------------------
typedef signed short SHORT; // s
typedef unsigned short USHORT; // u
typedef unsigned int FSHORT; // fs
typedef signed char CHAR; // ch
typedef unsigned char ENUM; // enum
typedef unsigned long ULONG; // ul
typedef unsigned long FLONG; // fl
typedef SHORT FAR *LPSHORT; // lps
typedef USHORT FAR *LPUSHORT; // lpu
typedef USHORT IPROP; // iprop
typedef HANDLE HFORMFILE; // hformfile
typedef USHORT ERR; // err
typedef WORD HPIC; // hpic
typedef HPIC FAR *LPHPIC; // lphpic
#ifndef WIN32
typedef LPSTR HSZ; // hsz
#endif
typedef LPVOID HLSTR; // hlstr
typedef HLSTR FAR *LPHLSTR; // lphlstr
typedef LPVOID HAD; // hAD - handle to Basic array desc.
typedef LPVOID HCTL; // hctl
typedef LONG (FAR PASCAL *PFNWP)(HWND hwnd, USHORT msg, USHORT wp, LONG lp); // pfnwp
typedef LONG (FAR PASCAL *PCTLPROC)(HCTL hctl, HWND hwnd, USHORT msg, USHORT wp, LONG lp); // pctlproc
//---------------------------------------------------------------------------
// Language Variant structures
//---------------------------------------------------------------------------
typedef struct
{
LONG lo;
LONG hi;
} CURRENCY;
typedef union
{
SHORT i2;
LONG i4;
float r4;
double r8;
CURRENCY cy;
HLSTR hlstr;
} VALUE;
typedef VALUE FAR *LPVAL;
// The size of Variant is needed when a Variant is passed by value or in a
// structure (user-defined type).
typedef struct
{
char v[16];
} VARIANT;
typedef VARIANT FAR *LPVAR;
// Variant type constants. these are the return value of GetVariantType.
// these are also defined in Constant.Txt for return value of VarType()
#define VT_EMPTY 0 // Empty
#define VT_NULL 1 // Null
#define VT_I2 2 // Integer
#define VT_I4 3 // Long
#define VT_R4 4 // Single
#define VT_R8 5 // Double
#define VT_CURRENCY 6 // Currency
#define VT_DATE 7 // Date
#define VT_STRING 8 // String
//---------------------------------------------------------------------------
// COLOR - a Windows RGB DWORD value.
//---------------------------------------------------------------------------
typedef unsigned long COLOR;
typedef COLOR FAR *LPCOLOR; // lpcolor
#define COLOR_DEFBITON 0x80000000 // bit set -> Win SysColor, not RGB
// Get RGB value from a color.
#define RGBCOLOR(clr) \
(((clr)&COLOR_DEFBITON)?(GetSysColor((int)((clr)&0xFFFF))):((clr)&0xFFFFFF))
//---------------------------------------------------------------------------
// Property data structure
//---------------------------------------------------------------------------
typedef struct tagDATASTRUCT
{
LONG data; // Data for Get/Set
USHORT cindex; // Number of indecies
struct
{
USHORT datatype; // Type of nth index (Currently always DT_SHORT)
LONG data; // Value of nth index
} index[1]; // Currently, only 1-dim arrays supported
} DATASTRUCT;
typedef DATASTRUCT FAR *LPDATASTRUCT; // pds
typedef DATASTRUCT NEAR *NPDATASTRUCT; // npds
//---------------------------------------------------------------------------
// VISUAL BASIC variable types
//---------------------------------------------------------------------------
#define ET_I2 1 // 16 bit signed integer scalar or array variable
#define ET_I4 2 // 32 bit signed integer scalar or array variable
#define ET_R4 3
#define ET_R8 4 // 64 bit real scalar or array variable
#define ET_CY 5 // 64 bit currency scalar or array variable
#define ET_HLSTR 6 // string scalar or array variable
#define ET_SD 6 // older, unpreferred equivalent to ET_HLSTR
#define ET_FS 7 // fixed-length string variable
//---------------------------------------------------------------------------
// Control Property definitions and structures.
//---------------------------------------------------------------------------
#define PF_datatype 0x000000FFL
#define PF_fPropArray 0x00000100L
#define PF_fSetData 0x00000200L
#define PF_fSetMsg 0x00000400L
#define PF_fNoShow 0x00000800L
#define PF_fNoRuntimeW 0x00001000L
#define PF_fGetData 0x00002000L
#define PF_fGetMsg 0x00004000L
#define PF_fSetCheck 0x00008000L
#define PF_fSaveData 0x00010000L
#define PF_fSaveMsg 0x00020000L
#define PF_fLoadDataOnly 0x20010000L
#define PF_fLoadMsgOnly 0x20020000L
#define PF_fGetHszMsg 0x00040000L
#define PF_fUpdateOnEdit 0x00080000L
#define PF_fEditable 0x00100000L
#define PF_fPreHwnd 0x00200000L
#define PF_fDefVal 0x00400000L
#define PF_fNoInitDef 0x00800000L
#define PF_fNoRuntimeR 0x02000000L
#define PF_fNoMultiSelect 0x04000000L
typedef struct tagPROPINFO
{
PSTR npszName;
FLONG fl; // PF_ flags
BYTE offsetData; // Offset into static structure
BYTE infoData; // 0 or _INFO value for bitfield
LONG dataDefault; // 0 or _INFO value for bitfield
PSTR npszEnumList; // For type == DT_ENUM, this is
// a near ptr to a string containing
// all the values to be displayed
// in the popup enumeration listbox.
// Each value is an sz, with an
// empty sz indicated the end of list.
BYTE enumMax; // Maximum legal value for enum.
} PROPINFO;
typedef PROPINFO FAR * LPPROPINFO;
typedef PROPINFO NEAR * NPPROPINFO;
typedef PROPINFO NEAR * PPROPINFO;
typedef PPROPINFO FAR * LPPROPLIST;
typedef PPROPINFO NEAR * NPPROPLIST;
typedef PPROPINFO NEAR * PPROPLIST;
//---------------------------------------------------------------------------
// Values for PROP PF_datatype
//---------------------------------------------------------------------------
#define DT_HSZ 0x01
#define DT_SHORT 0x02
#define DT_LONG 0x03
#define DT_BOOL 0x04
#define DT_COLOR 0x05
#define DT_ENUM 0x06
#define DT_REAL 0x07
#define DT_XPOS 0x08 // Scaled from float to long twips
#define DT_XSIZE 0x09 // _SIZE scales without origin
#define DT_YPOS 0x0A // _POS subtracts origin
#define DT_YSIZE 0x0B // uses parent's scale properties
#define DT_PICTURE 0x0C
#define DT_HLSTR 0x0D
#define DT_OBJECT 0x20
//---------------------------------------------------------------------------
// Control event definitions and structures.
//---------------------------------------------------------------------------
#define EF_fNoUnload 0x00000001L
typedef struct tagEVENTINFO
{
PSTR npszName; // event procedure name suffix
USHORT cParms; // number of parameters
USHORT cwParms; // # words of parameters
PWORD npParmTypes; // list of parameter types
PSTR npszParmProf; // event parameter profile string
FLONG fl; // EF_ flags
} EVENTINFO;
typedef EVENTIN